export type EnvType = {
  v5: string;
  v1: string;
  test: string;
  prod: string;
};

export const ENV_CONFIG: EnvType = {
  v5: 'v5',
  v1: 'v1',
  test: 'test',
  prod: 'prod',
};

export const getEnvConfig = () => {
  return {
    appId: process.env.WECHAT_APP_ID,
    appSecret: process.env.WECHAT_APP_SECRET,
  };
};

export const getServiceUrl = (env: keyof EnvType) => {
  const urls = {
    v5: process.env.V5_SERVICE_URL,
    v1: process.env.V1_SERVICE_URL,
    test: process.env.TEST_SERVICE_URL,
    prod: process.env.PROD_SERVICE_URL,
  };
  return urls[env];
};

export const isProduction = process.env.NODE_ENV === 'production';
